package cloud.daodao.storm.common.user.model.security;

import cloud.daodao.storm.common.annotation.Sensitive;
import cloud.daodao.storm.common.serialize.Serializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

/**
 * @author DaoDao
 */
@Data
@Schema(title = "ResetPassword", description = "重置密码")
public class ResetPassword implements Serializer {

    @Schema(title = "id", description = "id", example = "1")
    @NotNull
    @Min(value = 1)
    @Max(value = Long.MAX_VALUE)
    private Long id;

    @Schema(title = "password", description = "密码", example = "1")
    @Size(min = 4, max = 20)
    @Pattern(regexp = "^(?=.*\\d)(?=.*[A-Z])(?=.*[a-z])[\\dA-Za-z_-]{4,20}$")
    @Sensitive(type = Sensitive.Type.PASSWORD)
    private String password;

}
